package il.ac.biu.cs.grossmm.api.keys;

/**
 * Repsesents a key entry. Key entry is a attrubute-key value used to
 * map attribute to a subkey in a parent key.
 */
public final class KeyEntry {
    private final Attribute attrubute;
    private final Key key;
    
    /**
     * Creates a new KeyEntry object
     * @param attribute the attribute
     * @param key the (sub)key
     */
    public KeyEntry(Attribute attribute, Key key) {
        this.attrubute = attribute;
        this.key = key;
    }

    /**
     * Gets attribute associated with this entry
     * @return attribute associated with this entry
     */
    public Attribute getAttribute() {
        return attrubute;
    }

    /**
     * Gets key associated with this entry
     * @return key associated with this entry
     */
    public Key getKey() {
        return key;
    }

    @Override
    public String toString() {
        return attrubute.toString() + " = " + key;
    }
}
